note
	description: "Summary description for {ITEM}."
	author: ""
	date: "$Date$"
	revision: "$Revision$"

class
	ITEM

create
	make

feature {ANY}

	type: HASH_TABLE [STRING, STRING]

	listeEntier: HASH_TABLE [INTEGER, STRING]

	listeChaine: HASH_TABLE [STRING, STRING]

	tableaux: HASH_TABLE [ARRAYED_LIST [STRING], STRING]

	make (entiers: HASH_TABLE [INTEGER, STRING]; chaines: HASH_TABLE [STRING, STRING]; listetab: HASH_TABLE [ARRAYED_LIST [STRING], STRING]; type_arg: HASH_TABLE [STRING, STRING])
		do
			type := type_arg
			listeEntier := entiers
			listeChaine := chaines
			tableaux := listetab
		end

	get_int (nom: STRING): INTEGER
		local
			retour: INTEGER
		do
			retour := listeEntier.item (nom)
			Result := retour
		end

	get_string (nom: STRING): STRING
		local
			retour: STRING
		do
			retour := listeChaine.item (nom)
			Result := retour
		end

	get_array (nom: STRING): ARRAYED_LIST [STRING]
		local
			retour: ARRAYED_LIST [STRING]
		do
			retour := tableaux.item (nom)
			Result := retour
		end

	set_string (nom: STRING; valeur: STRING)
		do
			listeChaine.put (valeur, nom)
		end

	set_int (nom: STRING; valeur: INTEGER)
		do
			listeEntier.put (valeur, nom)
		end

	arith (nom: STRING; op: STRING; valeur: INTEGER)
		local
			temp: INTEGER
		do
			temp := listeEntier.item (nom)
			if (op.is_equal ("+")) then
				temp := temp + valeur
			elseif (op.is_equal ("-")) then
				temp := temp - valeur
			elseif (op.is_equal ("*")) then
				temp := temp * valeur
			elseif (op.is_equal ("/")) then
				temp := temp // valeur
			else
				temp := temp \\ valeur
			end
		end

	ajouteArray (nom: STRING; element: STRING)
		local
			temp: ARRAYED_LIST [STRING]
		do
			temp := tableaux.item (nom)
			temp.put (element)
			tableaux.put (temp, nom)
		end

	supprimeArray (nom: STRING; element: STRING)
		local
			test: ANY
			temp: ARRAYED_LIST [STRING]
			i: INTEGER
		do
			temp := tableaux.item (nom)
			i := temp.index_of (element, 1)
			temp.go_i_th (i)
			temp.remove
			tableaux.put (temp, nom)
		end

end
